#include<stdio.h>
int main(){
	int n,X,c=0,i,j,s;
	scanf("%d%d",&n,&X);
	int a[n];
	for(i=0;i<n;++i)
		scanf("%d",&a[i]);
	for(i=0;i<(1<<n);++i){
		s=0;
		for(j=0;j<n;++j)
			if(i&(1<<j))
				s+=a[j];
		if(s==X)
			c++;
	}
	printf("%d",c);
	return 0;
}
